#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @File : main_pages.py
# @Autor: FY
# @Date: 2021/8/30
from selenium.webdriver.common.by import By

from pages.add_member_page import AddMemberPage
from pages.base_page import BasePage


class MainPage(BasePage):
    _base_url = r"https://work.weixin.qq.com/wework_admin/loginpage_wx?"

    def goto_addMemberPage(self):
        '''
        点击 添加成员  成功跳转
        :return AddMemberPage:
        '''
        self.click_element(By.XPATH, '//a[@node-type="addmember"]')
        return AddMemberPage(self.driver)

    def goto_addMemberPageFailed(self):
        '''
        点击  添加成员  没有正常跳转
        :return 当前页:
        '''
        self.click_element(By.XPATH, '//a[@node-type="addmember"]')
        return MainPage(self.driver)
